package com.haozi.ehub.core.dynamic;

import com.haozi.ehub.core.enums.DatabaseEnum;

/**
 * @author ：terry
 * @date ：Created in 2020/6/5 14:09
 * @version: 1.0
 */
@Deprecated
public class DynamicDatabaseContextHolder {
    private static ThreadLocal<DatabaseEnum> contextHolder = new InheritableThreadLocal<>();

    public static void setDatabase(DatabaseEnum database) {
        contextHolder.set(database);
    }

    public static DatabaseEnum getDatabase(){
        return contextHolder.get();
    }
}
